home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1996 June / macformat-038.iso / Demos / Interactive Wave / _DATAS / SHARED.Dxr / 00986_Gestion des QuickTime.ls < prev    next >
Encoding:
Text File  |  1995-08-06  |  7.0 KB  |  258 lines

  1. on CoupeSonQ
  2.   global glQTmemo
  3.   if soundBusy(1) = 0 then
  4.     exit
  5.   end if
  6.   if getAt(glQTmemo, 2) = 0 then
  7.     exit
  8.   end if
  9.   if the movieRate of sprite getAt(glQTmemo, 1) <> 0 then
  10.     Cson(1)
  11.   end if
  12. end
  13.  
  14. on QuickPlayStartEnd Piste, NumCast, StartMovieTime, EndMovieTime
  15.   global glQTmemo
  16.   if Piste = #auto then
  17.     set Piste to getAt(glQTmemo, 1)
  18.   end if
  19.   if NumCast = #auto then
  20.     set NumCast to the castNum of sprite Piste
  21.   end if
  22.   if StartMovieTime = "Debut" then
  23.     set StartMovieTime to the movieTime of sprite Piste
  24.   end if
  25.   if EndMovieTime = "Fin" then
  26.     set EndMovieTime to the duration of cast NumCast
  27.   end if
  28.   QTspriteStartEndTime([Piste, StartMovieTime, EndMovieTime])
  29.   QTspriteStart([Piste, NumCast, 0, StartMovieTime])
  30.   QTspriteStartEndTime([Piste, StartMovieTime, EndMovieTime])
  31.   QTspriteStart([Piste, #auto, 1, #auto])
  32. end
  33.  
  34. on QTScanAnnule
  35.   global glQTmemo
  36.   set glQTmemo to list(0, 0)
  37. end
  38.  
  39. on QTspriteAuto Piste
  40.   global glQTmemo
  41.   set glQTmemo to list(Piste, 0)
  42. end
  43.  
  44. on RecupQTauto rien
  45.   global glQTmemo
  46.   return getAt(glQTmemo, 1)
  47. end
  48.  
  49. on TestPresenceQT
  50.   global glQTmemo
  51.   if glQTmemo = list(0, 0) then
  52.     return 0
  53.   end if
  54.   set NumCast to the castNum of sprite getAt(glQTmemo, 1)
  55.   if NumCast < 1 then
  56.     QTScanAnnule()
  57.     return 1
  58.   end if
  59.   if the castType of cast NumCast = #digitalVideo then
  60.     return 0
  61.   end if
  62.   QTScanAnnule()
  63.   return 1
  64. end
  65.  
  66. on QTspriteStartTime ParaListe
  67.   global glQTmemo
  68.   if getAt(ParaListe, 1) <> #auto then
  69.     set Piste to getAt(ParaListe, 1)
  70.   else
  71.     set Piste to getAt(glQTmemo, 1)
  72.   end if
  73.   set glQTmemo to list(Piste, 0)
  74.   puppetSprite(Piste, 1)
  75.   updateStage()
  76.   set AccuDeb to getAt(ParaListe, 2)
  77.   if AccuDeb = "Debut" then
  78.     set AccuDeb to the movieTime of sprite Piste
  79.   end if
  80.   set the startTime of sprite Piste to AccuDeb
  81.   set the movieTime of sprite Piste to AccuDeb
  82.   updateStage()
  83. end
  84.  
  85. on QTspriteEndTime ParaListe
  86.   global glQTmemo
  87.   if getAt(ParaListe, 1) <> #auto then
  88.     set Piste to getAt(ParaListe, 1)
  89.   else
  90.     set Piste to getAt(glQTmemo, 1)
  91.   end if
  92.   set glQTmemo to list(Piste, 0)
  93.   puppetSprite(Piste, 1)
  94.   updateStage()
  95.   set NumDuCast to the castNum of sprite Piste
  96.   set AccuFin to getAt(ParaListe, 2)
  97.   if AccuFin = "Fin" then
  98.     set AccuFin to the duration of cast NumDuCast
  99.   end if
  100.   set the stopTime of sprite Piste to AccuFin
  101.   updateStage()
  102. end
  103.  
  104. on QTspriteStartEndTime ParaListe
  105.   global glQTmemo
  106.   if getAt(ParaListe, 1) <> #auto then
  107.     set Piste to getAt(ParaListe, 1)
  108.   else
  109.     set Piste to getAt(glQTmemo, 1)
  110.   end if
  111.   set glQTmemo to list(Piste, 0)
  112.   puppetSprite(Piste, 1)
  113.   updateStage()
  114.   set NumDuCast to the castNum of sprite Piste
  115.   set AccuDeb to getAt(ParaListe, 2)
  116.   if AccuDeb = "Debut" then
  117.     set AccuDeb to the movieTime of sprite Piste
  118.   end if
  119.   set AccuFin to getAt(ParaListe, 3)
  120.   if AccuFin = "Fin" then
  121.     set AccuFin to the duration of cast NumDuCast
  122.   end if
  123.   set the startTime of sprite Piste to AccuDeb
  124.   set the stopTime of sprite Piste to AccuFin
  125.   updateStage()
  126.   set the movieTime of sprite Piste to AccuDeb
  127.   updateStage()
  128. end
  129.  
  130. on QTspriteStart ParaListe
  131.   global glQTmemo
  132.   if getAt(ParaListe, 1) <> #auto then
  133.     set Piste to getAt(ParaListe, 1)
  134.   else
  135.     set Piste to getAt(glQTmemo, 1)
  136.   end if
  137.   set glQTmemo to list(Piste, 0)
  138.   puppetSprite(Piste, 1)
  139.   updateStage()
  140.   if getAt(ParaListe, 2) <> #auto then
  141.     set NumDuCast to the number of cast getAt(ParaListe, 2)
  142.   else
  143.     set NumDuCast to the castNum of sprite Piste
  144.   end if
  145.   if the sound of cast NumDuCast <> 0 then
  146.     if getAt(ParaListe, 3) <> 0 then
  147.       Cson(1)
  148.     end if
  149.     setAt(glQTmemo, 2, 1)
  150.   end if
  151.   set VolumeSprite to 255
  152.   if count(ParaListe) > 4 then
  153.     if getAt(ParaListe, 5) <> #auto then
  154.       set VolumeSprite to getAt(ParaListe, 5)
  155.     end if
  156.     set the video of cast NumDuCast to getAt(ParaListe, 6)
  157.     set the sound of cast NumDuCast to getAt(ParaListe, 7)
  158.     set the controller of cast NumDuCast to getAt(ParaListe, 8)
  159.     set the pausedAtStart of cast NumDuCast to getAt(ParaListe, 9)
  160.     set the loop of cast NumDuCast to getAt(ParaListe, 10)
  161.     set the preLoad of cast NumDuCast to getAt(ParaListe, 11)
  162.     set the crop of cast NumDuCast to getAt(ParaListe, 12)
  163.     set the center of cast NumDuCast to getAt(ParaListe, 13)
  164.     set the frameRate of cast NumDuCast to getAt(ParaListe, 14)
  165.   end if
  166.   set the directToStage of cast NumDuCast to 1
  167.   set the visible of sprite Piste to 1
  168.   set the castNum of sprite Piste to NumDuCast
  169.   updateStage()
  170.   set the volume of sprite Piste to VolumeSprite
  171.   set the movieRate of sprite Piste to getAt(ParaListe, 3)
  172.   if getAt(ParaListe, 4) <> #auto then
  173.     set the movieTime of sprite Piste to getAt(ParaListe, 4)
  174.   end if
  175.   RestoreVolume()
  176. end
  177.  
  178. on QTspriteStop ParaListe
  179.   global glQTmemo
  180.   if listp(Parametre) then
  181.     set Parametre to getAt(Parametre, 1)
  182.   end if
  183.   if Parametre <> #auto then
  184.     set Piste to Parametre
  185.   else
  186.     set Piste to getAt(glQTmemo, 1)
  187.   end if
  188.   set glQTmemo to list(Piste, 0)
  189.   puppetSprite(Piste, 1)
  190.   updateStage()
  191.   set NumDuCast to the castNum of sprite Piste
  192.   set AccuS to the sound of cast NumDuCast
  193.   set the sound of cast NumDuCast to 0
  194.   set the movieRate of sprite Piste to 0
  195.   updateStage()
  196.   set the sound of cast NumDuCast to AccuS
  197.   RestoreVolume()
  198. end
  199.  
  200. on QTspriteEfface Parametre
  201.   global glQTmemo
  202.   if listp(Parametre) then
  203.     set Parametre to getAt(Parametre, 1)
  204.   end if
  205.   if Parametre <> #auto then
  206.     set Piste to Parametre
  207.   else
  208.     set Piste to getAt(glQTmemo, 1)
  209.   end if
  210.   set NumDuCast to the castNum of sprite Piste
  211.   if NumDuCast > 0 then
  212.     if the castType of cast NumDuCast = #digitalVideo then
  213.       puppetSprite(Piste, 1)
  214.       updateStage()
  215.       set AccuS to the sound of cast NumDuCast
  216.       set AccuV to the video of cast NumDuCast
  217.       set the volume of sprite Piste to 0
  218.       set the movieRate of sprite Piste to 0
  219.       set the sound of cast NumDuCast to 0
  220.       set the video of cast NumDuCast to 0
  221.       set the visible of sprite Piste to 0
  222.       updateStage()
  223.       set the sound of cast NumDuCast to AccuS
  224.       set the video of cast NumDuCast to AccuV
  225.       puppetSprite(Piste, 0)
  226.     end if
  227.   end if
  228.   QTScanAnnule()
  229.   RestoreVolume()
  230. end
  231.  
  232. on QTspriteVolume ParaListe
  233.   global glQTmemo
  234.   if getAt(ParaListe, 1) <> #auto then
  235.     set Piste to getAt(ParaListe, 1)
  236.   else
  237.     set Piste to getAt(glQTmemo, 1)
  238.   end if
  239.   set glQTmemo to list(Piste, 0)
  240.   puppetSprite(Piste, 1)
  241.   updateStage()
  242.   set the volume of sprite Piste to getAt(ParaListe, 2)
  243.   RestoreVolume()
  244. end
  245.  
  246. on QTCastDef ParaListe
  247.   set NumDuCast to the number of cast getAt(ParaListe, 1)
  248.   set the video of cast NumDuCast to getAt(ParaListe, 2)
  249.   set the sound of cast NumDuCast to getAt(ParaListe, 3)
  250.   set the controller of cast NumDuCast to getAt(ParaListe, 4)
  251.   set the pausedAtStart of cast NumDuCast to getAt(ParaListe, 5)
  252.   set the loop of cast NumDuCast to getAt(ParaListe, 6)
  253.   set the preLoad of cast NumDuCast to getAt(ParaListe, 7)
  254.   set the crop of cast NumDuCast to getAt(ParaListe, 8)
  255.   set the center of cast NumDuCast to getAt(ParaListe, 9)
  256.   set the frameRate of cast NumDuCast to getAt(ParaListe, 10)
  257. end
  258.